#include <cstdio>
#include <cstdlib>
using namespace std;

int main()
{
    int num, *score_list;
    while (true) {
        scanf(" %d", &num);
        if (num == 0) 
            break;
        score_list = (int*)malloc(num * sizeof(int));
        for (int i = 0; i < num; i++) 
            scanf(" %d", &score_list[i]);
        int target_score, count = 0;
        scanf(" %d", &target_score);
        for (int i = 0; i < num; i++)
            if (score_list[i] == target_score)
                count++;
        printf("%d\n", count);
        free(score_list);
    }

    return 0;
}